﻿@model SIG.Model.ViewModel.Back.SocialVM
@{
    
    ViewBag.Title = "社交资料";
    ViewBag.PageTitle = ViewBag.Title + "_常规设置";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    Html.EnableUnobtrusiveJavaScript(true);

    var options = new AjaxOptions()
    {
        Url = Url.Action("Social", "Info"),
        LoadingElementId = "saving",
        LoadingElementDuration = 2000,
     //   Confirm = "Are you sure you want to save this User?"
        OnSuccess = "updateSuccess"
        
    };  

}
@section header{     
    <script src="~/Areas/Admin/Content/Plugins/ckfinder/ckfinder.js"></script>
}


@section leftNav{
    @Html.Partial("_NavForInfo")
}



<div class="main-content">
    
    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="glyphicon glyphicon-comment"></i> @ViewBag.Title
        </div>
        <div class="panel-body">
            @using (Ajax.BeginForm("Social", null, options, new { @class = "form-horizontal", role = "form" }))
            {

                @Html.AntiForgeryToken()
                @Html.ValidationSummary()


                <div class="form-group">
                    @Html.LabelFor(model => model.Oicq, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.Oicq, new { @class = "form-control", placeholder = ModelMetadata.FromLambdaExpression(x => x.Oicq, ViewData).Watermark })
                        @Html.ValidationMessageFor(model => model.Oicq)
                    </div>
                  
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.OicqTwo, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.OicqTwo, new { @class = "form-control", placeholder = ModelMetadata.FromLambdaExpression(x => x.OicqTwo, ViewData).Watermark })
                        @Html.ValidationMessageFor(model => model.OicqTwo)
                    </div>
                   
                </div>


                <div class="form-group">
                    @Html.LabelFor(model => model.SinaWeibo, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.SinaWeibo, new { @class = "form-control", placeholder = "新浪微博" })
                        @Html.ValidationMessageFor(model => model.SinaWeibo)
                    </div>
                   
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.WeiXing, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.WeiXing, new { @class = "form-control", placeholder = "微信帐号" })
                        @Html.ValidationMessageFor(model => model.WeiXing)
                    </div>                  
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.WeiXingCode, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        <div class="input-group">
                            @Html.TextBoxFor(model => model.WeiXingCode, new { @class = "form-control", placeholder = "微信二维码" })
                            <span class="input-group-btn">
                                <button class="btn btn-default" id="btnWeiXingCode" type="button">浏览…</button>
                            </span>
                        </div><!-- /input-group -->
                        @Html.ValidationMessageFor(model => model.WeiXingCode)
                    </div>
                   
                </div>
                
                <div class="form-group">
                    <div class="col-sm-offset-2 col-md-10">
                        <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save"></span> 保存资料</button>
                    </div>
                    @*<div class="col-md-7">
                    @TempData["message"]
                </div>*@
                </div>
            }
        </div>
    </div>
    

</div>


@section footer {


    @Scripts.Render("~/bundles/jqueryval")

<script>
    function updateSuccess(data) {
        Common.ShowBox(data.Status, data.Message, "@ViewBag.Title");
    }

   // CKFinder.setupCKEditor(editor, '@Url.Content("~/plugins/ckfinder/")');


    function SetThumbnail(fileUrl) {
        $('#WeiXingCode').val(fileUrl);
    }


    $(function () {

        $("#btnWeiXingCode").on("click", function () {
            var finder = new CKFinder();
            //  finder.basePath = '/plugins/ckfinder/';
            finder.selectActionFunction = SetThumbnail;
            finder.popup();
        });

        Common.ActiveCurrentNav();

      //  $('#leftNav a:nth-of-type(4)').addClass('active');
    });
</script>
  
}
